@use './mixin.scss';
@use './transition.scss';
@use './element-ui.scss';
@use './sidebar.scss';
@use './btn.scss';
@use './ruoyi.scss';
@use './utils.scss';

body {
  height: 100%;
  margin: 0;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family:
    Helvetica Neue,
    Helvetica,
    PingFang SC,
    Hiragino Sans GB,
    Microsoft YaHei,
    Arial,
    sans-serif;
}

label {
  font-weight: 700;
}

html {
  height: 100%;
  box-sizing: border-box;
}

#app {
  height: 100%;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

.no-padding {
  padding: 0px !important;
}

.padding-content {
  padding: 4px 0;
}

a:focus,
a:active {
  outline: none;
}

a,
a:focus,
a:hover {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

div:focus {
  outline: none;
}

.fr {
  float: right;
}

.fl {
  float: left;
}

.pr-5 {
  padding-right: 5px;
}

.pl-5 {
  padding-left: 5px;
}

.block {
  display: block;
}

.pointer {
  cursor: pointer;
}

.inlineBlock {
  display: block;
}

.clearfix {
  &:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: ' ';
    clear: both;
    height: 0;
  }
}

aside {
  background: #eef1f6;
  padding: 8px 24px;
  margin-bottom: 20px;
  border-radius: 2px;
  display: block;
  line-height: 32px;
  font-size: 16px;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans',
    'Droid Sans', 'Helvetica Neue', sans-serif;
  color: #2c3e50;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  a {
    color: #337ab7;
    cursor: pointer;

    &:hover {
      color: rgb(32, 160, 255);
    }
  }
}

//main-container全局样式
.app-container {
  padding: 20px;
}

.components-container {
  margin: 30px 50px;
  position: relative;
}

.text-center {
  text-align: center;
}

.sub-navbar {
  height: 50px;
  line-height: 50px;
  position: relative;
  width: 100%;
  text-align: right;
  padding-right: 20px;
  transition: 600ms ease position;
  background: linear-gradient(
    90deg,
    rgba(32, 182, 249, 1) 0%,
    rgba(32, 182, 249, 1) 0%,
    rgba(33, 120, 241, 1) 100%,
    rgba(33, 120, 241, 1) 100%
  );

  .subtitle {
    font-size: 20px;
    color: #fff;
  }

  &.draft {
    background: #d0d0d0;
  }

  &.deleted {
    background: #d0d0d0;
  }
}

.link-type,
.link-type:focus {
  color: #337ab7;
  cursor: pointer;

  &:hover {
    color: rgb(32, 160, 255);
  }
}

.filter-container {
  padding-bottom: 10px;

  .filter-item {
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 10px;
  }
}

// 全局的定义
.container {
  height: 100% !important;
}

// =============== 🌟 高级：滚动条 hover 显示 ===============
// 滚动条颜色变量（可统一管理）
$scrollbar-thumb-bg: #b0b0b0;
$scrollbar-thumb-hover-bg: #888;
$scrollbar-track-bg: transparent;
$scrollbar-width: 6px;
$scrollbar-radius: 6px;

$scrollbar-thumb-bg: rgba(150, 150, 150, 0.5);
$scrollbar-thumb-hover-bg: rgba(100, 100, 100, 0.8);
$scrollbar-width: 6px;

// 默认隐藏滚动条（但可滚动）
html {
  scrollbar-width: none; /* Firefox 隐藏 */
  -ms-overflow-style: none; /* IE/Edge 隐藏 */
}

body,
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

// 所有可滚动容器：hover 时显示美观滚动条
*::-webkit-scrollbar {
  width: $scrollbar-width;
  height: $scrollbar-width;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}

*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: $scrollbar-radius;
}

*::-webkit-scrollbar-thumb {
  background: $scrollbar-thumb-bg;
  border-radius: $scrollbar-radius;
  transition: background 0.3s ease;
}

/* 当鼠标悬停在任意可滚动元素上时，显示滚动条 */
*:hover::-webkit-scrollbar,
*:focus-within::-webkit-scrollbar {
  opacity: 1;
}

*:hover::-webkit-scrollbar-thumb {
  background: $scrollbar-thumb-hover-bg;
}

/* 特别推荐：给明确的滚动容器加类名控制（更精准） */
.scrollbar-custom,
.scrollable-content,
.el-select-dropdown,
.el-drawer__body,
.el-dialog__body {
  &::-webkit-scrollbar {
    width: $scrollbar-width;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  &::-webkit-scrollbar-thumb {
    background: $scrollbar-thumb-bg;
    border-radius: $scrollbar-radius;
  }

  &:hover::-webkit-scrollbar {
    opacity: 1;
  }

  &:hover::-webkit-scrollbar-thumb {
    background: $scrollbar-thumb-hover-bg;
  }
}

// 自定义全局样式
.upload-box {
  .el-upload-list {
    height: 100px;

    .el-upload,
    .el-upload-list__item {
      width: 100px;
      height: 100px;
    }
  }
}

.el-menu-item * {
  vertical-align: inherit !important;
}
